export type RenderType = "page" | "jump";

export interface ListItemProps {
  type: RenderType;
  pageNum: number;
  active: boolean;
}

export interface JumperProps {
  type: RenderType;
  jumpNum: number;
  direction: "prev" | "next";
}

export type PageListItemProps<T> = T extends "page"
  ? ListItemProps
  : JumperProps;

export type CalculatePageList = (
  total: number,
  current: number,
  pageSize: number
) => Array<PageListItemProps<"page" | "jump">>;

export interface PaginationProps {
  current?: number;
  defaultCurrent?: number;
  defaultPageSize?: number;
  pageSize?: number;
  total: number;
  onChange?: (page: number, pageSize: number) => void;
  mini?: boolean;
}
